package com.gray.blog.common.util.thread;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;

/**
 * 线程池创建方法（系统用户，各模块线程池不同）
 * Created  By zhoux 2019/09/11
 **/
public class SysUserThreadPoolUtils {

    private static Integer POOL_NUMBER = Runtime.getRuntime().availableProcessors() + 1;

    private static String name = "Sys_User";

    public static ExecutorService service = NamedThreadPool.newFixedThreadPool(POOL_NUMBER, "Sys_User");

    public static void execute(Runnable command) {
        service.execute(command);
    }

    public static Future<?> submit(Runnable command) {
        return service.submit(command);
    }

}
